package com.lhh.myspringboot.java8;

import com.lhh.myspringboot.bean.Dog;

public class LambdaTest4 {


    public static void main(String[] args) {


        // 普通方式
        DogService dogService=()->{
            return new Dog();
        };
        dogService.getDog();

        // 简化方式
        DogService dogService2=()->new Dog();
        dogService2.getDog();

        // 构造方法引用
        DogService dogService3=Dog::new;
        dogService3.getDog();

        // 构造方法引用 有参
        DogService2 dogService21=Dog::new;
        dogService21.getDog("小米",11);
    }

    interface DogService{
        Dog getDog();

    }

    interface DogService2{
        Dog getDog(String name,int age);
    }
}
